home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-08 | 45.0 KB | 1,146 lines | [TEXT/R*ch] |
- C.S.M.P. Digest Mon, 02 Nov 92 Volume 1 : Issue 204
-
- Today's Topics:
-
- SCSI Disk Format & Initialization
- Launching from a document file
- Finding system folder in system 6
- Double Click in Window Content
- Bug fixes in MPW C 3.2.4
- Think Pascal and ResEdit questions
-
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- The digest is a collection of article threads from the internet newsgroup
- comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi-
- regularly and want an archive of the discussions. If you don't know what a
- newsgroup is, you probably don't have access to it. Ask your systems
- administrator(s) for details. (This means you can't post questions to the
- digest.)
-
- Each issue of the digest contains one or more sets of articles (called
- threads), with each set corresponding to a 'discussion' of a particular
- subject. The articles are not edited; all articles included in this digest
- are in their original posted form (as received by our news server at
- cs.uoregon.edu). Article threads are not added to the digest until the last
- article added to the thread is at least one month old (this is to ensure that
- the thread is dead before adding it to the digest). Article threads that
- consist of only one message are generally not included in the digest.
-
- The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
- [128.223.8.8] in the directory /pub/mac/csmp-digest. Be sure to read the
- file /pub/mac/csmp-digest/README before downloading any files. The most
- recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
- directory /info-mac/digest/csmp. If you don't have ftp capability, the sumex
- archive has a mail server; send a message with the text '$MACarch help' (no
- quotes) to LISTSERV@ricevm1.rice.edu for more information.
-
- The digest is also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new issue as it is created. Sorry, back issues
- are not available through the mailing list.
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
-
- -------------------------------------------------------
-
- From: kravitz@foxtail.com (Jody Kravitz)
- Subject: SCSI Disk Format & Initialization
- Organization: The Foxtail Group
- Date: Sun, 27 Sep 1992 17:16:11 GMT
-
- Could someone explain to me (or point me to the appropriate CURRENT
- reference) how it is decided if a SCSI disk is a valid Mac disk.
-
- I have used a shareware progrogram SCSI Format&Init to initialize a 40 Meg
- drive. However I find that I must use the 'mountem' FKEY to get it to
- mount after a reboot. This leads me to wonder if the data structures
- put on the disk by SCSI Format&Init are current.
-
- Thanks
-
- Jody
-
- +++++++++++++++++++++++++++
-
- From: minow@Apple.COM (Martin Minow)
- Date: 28 Sep 92 17:43:30 GMT
- Organization: Apple Computer Inc., Cupertino, CA
-
- In article <1992Sep27.171611.9373@foxtail.com> kravitz@foxtail.com
- (Jody Kravitz) notes that a scsi disk will not automount.
-
- The Macintosh SCSI implementation predates ANSI-SCSI by about four years.
- Unfortunately, this means that there are a few incompatibilities between
- the Mac and "standard" SCSI. Jody is probably being bitten by a requirement
- (in "standard" SCSI) for devices to warn the host computer that they have
- just been powered up or reset. The sequence is
-
- 1. System powers up.
- 2. Host computer resets the SCSI bus.
- 3. Host computer sends "test unit ready" to see if there's a device.
- 4. Device, having just been reset, sends "check condition" (warning) status.
- 5. Host computer sends "get extended sense" (give my the error status).
- 6. Device sends unit-attention "I've just been reset or powered up"
- 7. Host computer sends "test unit ready" again. This time it succeeds.
-
- The Mac assumes that any "check condition" indicates an error and skips
- the mount. You can work around this by using SCSI Probe (or similar
- Control Panels) or an INIT to clear the unit attention condition and retry
- the mount. Alternately, the disk manufacturer may choose to add Apple-specific
- firmware that supresses power-up unit attention.
-
- Hope this clarifies things slightly.
-
- Martin Minow
- minow@apple.com
- ps: the sequence above is more than slightly simplified. Read the Ansi
- SCSI-II spec for the gory details.
-
- ---------------------------
-
- From: paul@svl.cdc.com (Paul Kohlmiller)
- Subject: Launching from a document file
- Date: 11 Sep 92 23:26:42 GMT
-
- I am successfully launching applications via LaunchApplication.
- The problem what I would really like to do is launch from a
- document not from the application file itself. I want to be able
- to do the equivalent of double-clicking a MSWord document and have it
- come up with that document open. I think I need something like
- LaunchApplicationwithOpenFile but I don't see this in IM Processes or
- IM Files (on CD). Getting the application name from the document file
- is probably not too hard but how do I get it to launch the app and open
- the file, too?
- thnx
-
- - --
- // Paul H. Kohlmiller // "Cybers, Macs and Mips" //
- // Control Data Systems, Inc. // Internet: paul@svl.cdc.com //
- // Acronym under construction. // America Online: Paul CDC //
- // All comments are strictly my own. I won't lie but my //
- // perception of reality is at best a personal hunch. //
-
- +++++++++++++++++++++++++++
-
- From: sorchard@crowded-house.den.mmc.com (Steve Orchard)
- Date: 14 Sep 92 14:15:11 GMT
- Organization: Martin Marietta
-
- In article <47491@shamash.cdc.com>, paul@svl.cdc.com (Paul Kohlmiller) writes:
- >
- > I am successfully launching applications via LaunchApplication.
- > The problem what I would really like to do is launch from a
- > document not from the application file itself. I want to be able
- > to do the equivalent of double-clicking a MSWord document and have it
- > come up with that document open. I think I need something like
- > LaunchApplicationwithOpenFile but I don't see this in IM Processes or
- > IM Files (on CD). Getting the application name from the document file
- > is probably not too hard but how do I get it to launch the app and open
- > the file, too?
- > thnx
-
- You must set the Finder Information first and then launch the Application.
- Below is the code I use to do this for system 6. For system 7 and beyond
- use AppleEvents. Check out the code snippet on ftp.apple.com.
-
-
- typedef struct
- {
- int message; /* Open = 0, Print = 1 */
- int count; /* Number of docs selected. */
- AppFile findinfo; /* AppFile structure */
- } **FindrInfo;
-
- void setfinder(thepath,num)
- Str255 thepath;
- int num;
- {
- OSErr err;
- FindrInfo finderstuff;
- FInfo finfo;
- int i,strsize;
- AppFile *temp;
-
- err = GetFInfo(thepath,0,&finfo);
- HUnlock(AppParmHandle);
- if(num==1)
- SetHandleSize(AppParmHandle,(Size)(sizeof(AppFile)+4));
- else
- SetHandleSize(AppParmHandle,(Size)(sizeof(AppFile))+(Size)(sizeof(AppParmHandle)));
- MoveHHi(AppParmHandle);
- HLock(AppParmHandle);
- finderstuff = (FindrInfo)AppParmHandle;
- (**finderstuff).message=0;
- (**finderstuff).count=num;
- temp = &(**finderstuff).findinfo;
- for(i=1;i!=num;i++)
- {
- strsize = *temp->fName + 9;
- if((strsize % 2) != 0) strsize=strsize+1;
- temp=(Ptr)temp + strsize;
- }
- temp->fType=finfo.fdType;
- temp->vRefNum=finfo.fdFldr;
- strcpy(temp->fName,thepath);
- }
-
- Good Luck
- Steve Orchard
-
- +++++++++++++++++++++++++++
-
- From: pablo@malloco.ing.puc.cl (Pablo Millan)
- Date: 21 Sep 92 19:37:56 GMT
- Organization: Pontificia Universidad Catolica de Chile
-
- Paul Kohlmiller (paul@svl.cdc.com) wrote:
- : I am successfully launching applications via LaunchApplication.
- : The problem what I would really like to do is launch from a
- : document not from the application file itself. I want to be able
- : to do the equivalent of double-clicking a MSWord document and have it
- : come up with that document open. I think I need something like
- : LaunchApplicationwithOpenFile but I don't see this in IM Processes or
- : IM Files (on CD). Getting the application name from the document file
- : is probably not too hard but how do I get it to launch the app and open
- : the file, too?
- : thnx
- :
-
-
- Hi.
-
- Get the application name with Desktop Manager IM VI (I haven't see
- the new IM). (i can't remember the name)
-
- After you launch the application:
-
- Use AppleEvents (type odoc , Open Document) also documented in IM VI.
-
- sorry, but i don't know the old way, maybe someone else could help?
-
- - --
- - ------------------------------------------------------------------------------
- Pablo A. Millan L. | MIS OPINIONES SON MIAS (pero te las puedo vender)
- - ------------------------------------------------------------------------------
- email : pablo@seeds.cl | Seeds Limitada, Santiago, Chile
- - ------------------------------------------------------------------------------
- "Research is what I'm doing when I don't know what I'm doing" -- W. von Braun
- - --
- - ------------------------------------------------------------------------------
- Pablo A. Millan L. | MIS OPINIONES SON MIAS (pero te las puedo vender)
- - ------------------------------------------------------------------------------
- email : pablo@seeds.cl | Seeds Limitada, Santiago, Chile
- - ------------------------------------------------------------------------------
- "Research is what I'm doing when I don't know what I'm doing" -- W. von Braun
-
- +++++++++++++++++++++++++++
-
- From: steve.herman%express@freedom.msfc.nasa.gov (Steve Herman)
- Date: 24 Sep 92 14:21:05 GMT
- Organization: BCSS
-
- In article <1992Sep21.193756.7857@tolten.puc.cl>, pablo@malloco.ing.puc.cl
- (Pablo Millan) wrote:
- >
- > Paul Kohlmiller (paul@svl.cdc.com) wrote:
- > : I am successfully launching applications via LaunchApplication.
- > : The problem what I would really like to do is launch from a
- > : document not from the application file itself. I want to be able
- > : to do the equivalent of double-clicking a MSWord document and have it
- > : come up with that document open. I think I need something like
- > : LaunchApplicationwithOpenFile but I don't see this in IM Processes or
- > : IM Files (on CD). Getting the application name from the document file
- > : is probably not too hard but how do I get it to launch the app and open
- > : the file, too?
- > : thnx
- > :
- >
- >
- > Hi.
- >
- > Get the application name with Desktop Manager IM VI (I haven't see
- > the new IM). (i can't remember the name)
- >
- > After you launch the application:
- >
- > Use AppleEvents (type odoc , Open Document) also documented in IM VI.
- >
- > sorry, but i don't know the old way, maybe someone else could help?
- >
-
- Another way to accomplish this (under System 7) is to send Finder an "Open
- Selection" Apple Event. You place the document you want opened in the
- Apple Event and Finder figures out who the application to be launched is.
- If the app is not running it gets launched with an 'odoc' event. If it is
- already running, it gets brought to the front and sent an 'odoc' event.
-
- There is a code snippet on ETO which does this. I think it's called
- SendFinderOpen or something like that.
-
- I guess the only problem with this technique is that Finder is always going
- to launch the "creator" application. (ie I don't think you could trick it
- into opening a TeachText document with MS Word)
-
- - ----------------------------------------------------
- - - Steve Herman - BCSS
- - - Boeing Computer Support Services
- - - Huntsville, AL
- - ----------------------------------------------------
-
- ---------------------------
-
- From: udmorrow@mcs.drexel.edu (Daniel Morrow)
- Subject: Finding system folder in system 6
- Date: 28 Sep 92 02:45:24 GMT
- Organization: Drexel University
-
- Subject line says it all. I'm writing a program that will
- have a preference file. I know how to get the Preferences folder
- in System 7. I need to know how to get the System folder in
- System 6. Forgive me if this is a FAQ...
-
- Also, what is the best way to tell if system 6 or 7 is running?
-
- Thanks in advance.
- - -Dan.
-
- +++++++++++++++++++++++++++
-
- From: grobbins@Apple.COM (Grobbins)
- Date: 28 Sep 92 06:29:04 GMT
- Organization: Apple Computer Inc., Cupertino, CA
-
- In article <1992Sep28.024524.17596@mcs.drexel.edu> udmorrow@mcs.drexel.edu (Daniel Morrow) writes:
- >Subject line says it all. I'm writing a program that will
- >have a preference file. I know how to get the Preferences folder
- >in System 7. I need to know how to get the System folder in
- >System 6.
-
- Call FindFolder and ask for the preferences folder (kPreferencesFolderType).
- Under System 7, this will return the vRefNum and dirID of the
- Preferences folder; under System 6, it will return the vRefNum and
- dirID of the System folder (since that is where preferences should be
- kept.) FindFolder is documented on pages 9-42 and following of Inside
- Mac VI. Don't bother to call Gestalt to see if FindFolder is available;
- if you're using Think or MPW C or Pascal, the FindFolder glue
- will make certain that FindFolder succeeds on any HFS system.
-
- >Also, what is the best way to tell if system 6 or 7 is running?
-
- It's best to check if specific features are available, not what
- system is running. Gestalt is typically the way to go; read
- chapter 3 of Inside Mac VI.
-
- Grobbins grobbins@apple.com
-
- Usual disclaimers apply.
-
- ---------------------------
-
- From: mgraf@sydvm1.VNET.IBM.COM (Michael Graf)
- Date: Mon, 21 Sep 92 09:14:10 EST
- Subject: Double Click in Window Content
- Organization: Australian Programming Centre (IBMA)
-
- Can anyone please provide me with an algorithm, hint, pointer or advice
- which will allow me to detect DOUBLE CLICKs within the content region of
- a normal window ?
-
- I can easily detect single MouseDowns, but am not certain the best way
- to detect a double click.
-
- Thanx, in advance, for the help...
-
-
- **********************************************************************
- Regards,
- Michael Graf INTERNET: (mgraf@sydvm1.vnet.ibm.com)
- BITNET: (mgraf@vnet)
- **********************************************************************
-
- +++++++++++++++++++++++++++
-
- From: cstrockb@cs.sunysb.edu (Caleb Strockbine)
- Date: 22 Sep 92 04:20:03 GMT
- Organization: SUNY at Stony Brook Computer Science Dept.
-
- In article <19920920.161604.28@almaden.ibm.com> mgraf@sydvm1.VNET.IBM.COM (Michael Graf) writes:
- Can anyone please provide me with an algorithm, hint, pointer or advice
- which will allow me to detect DOUBLE CLICKs within the content region of
- a normal window ?
-
- You can use the trap GetDblTime() to find the maximum number of ticks
- allowed between the two clicks of a double click. (You can also use
- the system global DoubleTime directly, if you prefer globals to traps.)
-
- Compare the time between two clicks to see if it's less than the value
- returned by GetDblTime(). If it is, and if the clicks are close together,
- the click is actually a double click.
-
- Caleb.
- cstrockb@ic.sunysb.edu
-
- +++++++++++++++++++++++++++
-
- From: bowman@reed.edu (Eric Bowman (bobo))
- Date: 22 Sep 92 03:41:12 GMT
- Organization: Reed College, Portland, OR
-
- In article <CSTROCKB.92Sep21232004@csws1.cs.sunysb.edu> cstrockb@cs.sunysb.edu (Caleb Strockbine) writes:
- >In article <19920920.161604.28@almaden.ibm.com> mgraf@sydvm1.VNET.IBM.COM (Michael Graf) writes:
- > Can anyone please provide me with an algorithm, hint, pointer or advice
- > which will allow me to detect DOUBLE CLICKs within the content region of
- > a normal window ?
-
- >You can use the trap GetDblTime() to find the maximum number of ticks
- >allowed between the two clicks of a double click. (You can also use
- >the system global DoubleTime directly, if you prefer globals to traps.)
-
- >Compare the time between two clicks to see if it's less than the value
- >returned by GetDblTime(). If it is, and if the clicks are close together,
- >the click is actually a double click.
-
- This will work, but it's not quite right. MPW 411 says this about GetDblTime:
-
- GetDblTime returns the suggested maximum difference (in ticks) that should exist
- between the times of a mouse-up event and a mouse-down event for those two mouse
- clicks to be considered a double-click. The user can adjust this value by means of
- the Control Panel desk accessory.
-
- So you should catch mouse up events, and note store the time-of-event somewhere,
- then check it in your mouse down event catcher.
-
- bobo
- bowman@reed.edu
-
- +++++++++++++++++++++++++++
-
- From: mtc@henry.ece.cmu.edu (Magnetic Technology Center)
- Organization: dSoft (david's Software)
- Date: Tue, 22 Sep 1992 13:46:53 GMT
-
- [mgraf@sydvm1.VNET.IBM.COM (Michael Graf) writes:]
- [] Can anyone please provide me with an algorithm, hint, pointer or advice
- [] which will allow me to detect DOUBLE CLICKs within the content region of
- [] a normal window ?
-
- [cstrockb@cs.sunysb.edu (Caleb Strockbine) writes:]
- [] You can use the trap GetDblTime() to find the maximum number of ticks
- [] ...
- [] Compare the time between two clicks to see if it's less than the value
- [] returned by GetDblTime(). If it is, and if the clicks are close together,
- [] the click is actually a double click.
-
- [bowman@reed.edu (Eric Bowman (bobo)) writes:]
- [] This will work, but it's not quite right. MPW 411 says this about
- [] GetDblTime: returns the suggested maximum difference (in ticks) that
- [] should exist between the times of a mouse-up event and a mouse-down
- [] event for those two mouse clicks to be considered a double-click.
- [] ...
- [] So you should catch mouse up events, and note store the time-of-event
- [] somewhere, then check it in your mouse down event catcher.
-
- MPW 411 (and IM - Event Manager) does not resolve an idiosyncratic
- situation where a mousedown occurs followed by a lengthy pause with
- the mouse not moving and then, in rapid succesion, a mouseup and
- another mousedown. This satisfies both GetDblTime() and mouse
- movement constraints but generally isn't considered a double click
- (since the two mousedowns are not close enough together in time).
- This, apparently, is left open for the app writer to resolve.
-
- -dave-
- mtc@henry.ece.cmu.edu
-
- see also: StillDown(), WaitMouseUp() and IM - Event Manager
-
- +++++++++++++++++++++++++++
-
- From: sdorner@qualcomm.com (Steven Dorner)
- Date: 24 Sep 92 01:44:33 GMT
- Organization: Qualcomm, Inc
-
- Caleb Strockbine wrote:
- > the Finder measures times between mousedown events
- > a mouseup and a mousedown.
-
- The Finder also uses the wrong paradigm for shift-click in its list
- windows.
-
- > Since I generally do a lot more double clicking
- > in the Finder than anywhere else, and since I assume the average user
- > probably does the same, I guess I'll make my futre apps follow the
- > Finder's lead for the sake of consistancy.
-
- The Finder is not a paragon of virtue in any sense. If I had ATP
- conformant code, I don't think I'd change it to match the Finder (but your
- point about the Finder's prominence is well taken.)
-
- >Not that anyone would ever notice...
-
- Agreed.
-
- > triple clicks, too. I also think nobody uses them because of the difficulty
- > some folks have triple clicking.
-
- I'm getting pretty used to triple-click as "select paragraph". I certainly
- wouldn't make it the ONLY way to do something, but it can be handy as an
- accellerator.
-
- +++++++++++++++++++++++++++
-
- From: cstrockb@cs.sunysb.edu (Caleb Strockbine)
- Date: 25 Sep 92 09:56:19 GMT
- Organization: SUNY at Stony Brook Computer Science Dept.
-
- In article <sdorner-230992203342@dorner.slip.uiuc.edu> sdorner@qualcomm.com (Steven Dorner) writes:
-
- I'm getting pretty used to triple-click as "select paragraph". I certainly
- wouldn't make it the ONLY way to do something, but it can be handy as an
- accellerator.
-
- Absolutely. I don't have the guidelines handy, but I think there should
- always be an alternative to double clicking, too. Double clicking, as well
- as Option-, Shift-, or Command-clicking, is a shortcut that's not intuitive
- for the novice user. If all of those are used, things can get really hairy
- even for the experienced Mac user. I point to Illustrator as an example
- of a very difficult-to-master user interface.
-
- Caleb.
-
- +++++++++++++++++++++++++++
-
- From: jmatthews@desire.wright.edu
- Date: 25 Sep 92 05:28:54 GMT
- Organization: Wright State University
-
- In article <19920922.150650.277@almaden.ibm.com>, mgraf@sydvm1.VNET.IBM.COM (Michael Graf) writes:
- > Can anyone please provide me with an algorithm, hint, pointer or advice
- > which will allow me to detect DOUBLE CLICKs within the content region of
- > a normal window ?
-
- For the archives, here's code similar to what I sent Michael.
-
- var gLastMouseUp: EventRecord;
-
- procedure SaveLastMouseUp(event: EventRecord);
- begin
- gLastMouseUp := event
- end;
-
- function CheckDoubleClick (event: EventRecord): Boolean;
- var slop: Rect;
- begin
- with gLastMouseUp.where do
- SetRect(slop, h - 2, v - 2, h + 2, v + 2);
- CheckDoubleClick:= ((event.when - gLastMouseUp.when) <=
- GetDblTime) and (PtInRect(event.where, slop))
- end;
-
- In the main event loop, call SaveLastMouseUp in response to mouseUp
- events, and call CheckDoubleClick in response to mouseDown events. The
- latter returns true when a double click (as defined in IM vol.I,
- p.260) occurs.
-
- o----------------------------------------------------------------------------o
- | John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
- | "Whom the gods would destroy, they first invite to program in C" |
- o----------------------------------------------------------------------------o
-
- +++++++++++++++++++++++++++
-
- From: orpheus@reed.edu (P. Hawthorne)
- Date: 28 Sep 92 11:29:08 GMT
- Organization: Reed College, Portland, OR
-
-
- cstrockb@cs.sunysb.edu (Caleb Strockbine) writes:
- : Double clicking, as well as Option-, Shift-, or Command-clicking, is a
- : shortcut that's not intuitive for the novice user. If all of those are
- : used, things can get really hairy even for the experienced Mac user. I
- : point to Illustrator as an example of a very difficult-to-master user
- : interface.
-
- I point to Illustrator as the most effective user interface. It permits
- the user to become very expressive. Some short cuts are not intuitive, but
- I can assure you that they come to be instinctive. Still, implying that
- double clicking is too computery for people seems rather like saying that
- if God wanted us to compute, he would have given us mice to fidget with.
- People have to do something faintly like learning to communicate with a
- computer. It can't be entirely one way. But beyond that...
-
- Difficult-to-master? Yes! Mastering Illustrator is not like mastering a
- word processor or some trivial application. You wouldn't write Illustrator
- in HyperCard. Lest the user-friendly trappings disguise it, Illustrator is
- a Craft and a remarkably interesting subdiscipline of programming at that.
-
- I can't think of anything in Illustrator that one can do with the mouse
- and the keyboard that you cannot find in the menus or the toolbox. Every
- short cut has it's representation in the user interface.
-
-
- Theus (orpheus@reed.edu)
-
- P.S.
- Sorry for disappearing. I'm living... That might not be the right word.
- I'm merely 'in' Utah. I've moved here. I'm not dead exactly, either, but...
-
- ---------------------------
-
- From: Bruce.Hoult@bbs.actrix.gen.nz
- Subject: Bug fixes in MPW C 3.2.4
- Date: 21 Sep 92 11:42:11 GMT
- Organization: Actrix Information Exchange
-
- I don't think I've seen anyone post details of just what exactly was wrong
- with MPW C 3.2.3 on ETO #8.
-
- Well, I got the special 3.2.4 update posting (dated 18/9/92) today --
- kudos to the MPW guys for getting this out quickly.
-
- Here is part of the readme file (note that much of it is changes from
- 3.2 to 3.2.3):
-
- - -----
-
- These notes describe changes from MPW C 3.2.3 to 3.2.4
-
- The following bugs have been fixed:
-
- - - The compiler will sometimes generate incorrect code for complicated
- logical expressions containing constants. The error will occur when
- the logical expression is the controlling expression of a conditional
- ( ? : ) expression, or on the right side of an assignment statement.
- The symptom of this bug is that the logical expression will return the
- wrong value.
-
- For example the following generates incorrect code:
-
- x = (a > 0) && 1 && (a < 2) ? 1 : 2;
- or
- x = (a > 0) && 2 && (a < 2);
-
- - - The compiler will generate object files with an incorrect value in
- the FileID field of a Local Type record. Depending on the contents of
- the object file, the Linker (or Lib) may sometimes complain about the
- invalid record. If the link succeeds, the .SYM file will have
- incorrect information; the application will be correct.
-
- This bug occurs only when a program uses #pragma load and is compiled
- and Linked (or Libd) with -sym on.
-
- As a result of this fix, Load/Dump files created with earlier versions
- of the C compiler should be rebuilt.
-
- - - The compiler will incorrectly evaluate the following construct:
- aa < (bb << cc)
- or
- aa < (bb >> cc)
-
- when aa, bb, and cc are all constant expressions (i.e. either
- constants themselves or expressions all of whose operands are
- constants), aa is negative, and (bb << cc) or (bb >> cc) is greater
- than 65536.
-
-
- These notes describe changes from MPW C 3.2 to 3.2.3
-
- - - An increase in the number of allowable static strings to above 32K.
-
- - - Speed improvements ranging from 6% to 26% in compilation of large
- files with the option "-sym on".
-
- - - The option "-blksize n" has been added. The parameter "n" is the
- number of 512-byte blocks to be used for the compiler's input buffers.
- The range of "n" is from 4 to 63. You can use this option to tune the
- performance of the compiler for your particular hardware
- configuration. The default value of 16 seems to be a reasonable
- compromise for most classes of machines.
-
- Bug fixes
-
- - - The "-mc68020" option used to do an incorrect optimization for
- multiplication by twelve. This would often show up when calculating
- an offset in a large array of "extended" values. The bug showed up
- only when the value of the result required more than 15 bits.
-
- - - The compiler emits ID numbers for use by the Linker and debuggers.
- There used to be three ranges of these numbers. If there were enough
- symbols in a compilation unit, the number ranges could overlap, giving
- bogus symbolic information. The compiler now emits a single contiguous
- range of ID numbers, allowing up to 32K symbols to exist in one
- compilation unit.
-
- - - A logical operator (AND, OR) with a constant operand would sometimes
- cause a TEST instruction with an immediate operand to be emitted. This
- would cause an "illegal instruction" error at runtime.
-
- - - If a function allocated more than 32K of space for local variables,
- the compiler would not clean up the stack correctly. The compiler now
- detects the situation and emits a correct epilog for such functions.
-
- - - If a conditional expression had a function call as one alternative
- and a constant as the other, the result of the function call would get trashed.
-
- - - The compiler used to create illegal "multiply" instructions that
- used address registers as operands.
-
- - - There were bugs in the algorithm for dead-code elimination. The
- symptoms were that when using the "-b3" option with a function
- containing string literals (as in "printf" statements), seemingly
- random sections of the function would get trashed. This also happened,
- even in the absence of the "-b3" option, when the function contained
- floating point constants.
-
- - - If a function contained a local static variable, compiling with
- "-sym on" would cause random system crashes. Even if crashes did not
- occur, the symbolic information for that variable would be garbage.
-
- - - The compiler used to abort when a partial pathname was given in the
- "-i<filename>" option.
-
- - - Crashes occurred when source code contained floating point constants.
-
- - - Object files created using "-opt full" but not using any "-bn"
- option would fail to link when the source file contained a string literal.
-
- - - When evaluating constructs of the form: "ptr++->field = somevalue;",
- the address increment was calculated incorrectly in the high order
- byte, causing a problem when running in 32-bit addressing mode.
-
- - - Crashes sometimes occurred when compiling source using "-sym on"
- when the source contained a struct for which some field was created by
- a macro expansion.
-
- - - Incorrect parameter values were passed when the option "-mc68881"
- was used and the parameter was a constant that was explicitly cast to float.
-
- - - Logical tests of expressions of the form:
-
- someBooleanExpression && (someVar = pointerArray[i].ptr)
-
- failed because the generated code used an LEA instruction to assign
- the value of pointerArray[i].ptr despite the fact that LEA does not
- set the condition code.
-
- - - The condition codes were not properly tested in expressions of the form:
- if (x ? 1 : g() )
- if (x ? f() : g() )
-
- - - The condition codes were not tested properly when the results of two
- function calls were ANDed, e.g., func1() && func2().
-
- - - A bitwise OR of two logical expressions failed in some instances
- where one or both of the expressions was complex.
-
- - - Under the option "-model far", a function pointer referring to a
- function in the same segment was set to the code address instead of to
- the jump table address. This would cause the pointer to become
- invalid after the code segment was unloaded. This is now corrected,
- provided that the Link version used is from MPW 3.2.2 ( or later).
-
- - - A bug in the constant folding of Boolean expressions caused the
- generation of the
- illegal instruction TST.L #$0000 when compiling constructs like:
-
- someVar && (someExpression, 1)
- booleanVar = booleanVar && 1;
-
- - - The same bug would cause generation of an incorrect test for
- constructs like:
- if ((0 || (someVar && !someVar)) && 1)
-
- - - A code generation error occurred when a function was declared to
- return a pointer to a function.
-
- - - A bus error would occur when compiling with "-sym on".
- - --
- Bruce.Hoult@bbs.actrix.gen.nz Twisted pair: +64 4 477 2116
- BIX: brucehoult Last Resort: PO Box 4145 Wellington, NZ
- "Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB
- hard disk that fits in your pocket!" "Great! Is it PC compatible?"
-
- +++++++++++++++++++++++++++
-
- From: holiday@bnr.ca (Matthew Holiday)
- Date: 21 Sep 92 21:51:14 GMT
- Organization: Bell-Northern Research, Richardson, TX
-
- In article <1992Sep21.114211.2561@actrix.gen.nz>, Bruce.Hoult@bbs.actrix.gen.nz writes:
- |> I don't think I've seen anyone post details of just what exactly was wrong
- |> with MPW C 3.2.3 on ETO #8.
- |>
- |> Well, I got the special 3.2.4 update posting (dated 18/9/92) today --
- |> kudos to the MPW guys for getting this out quickly.
- |>
-
- Where exactly is the updated compiler? I'd like to get the 3.2.3 C/C++ update from APDA
- on CD-ROM, but I won't order it until I know for sure that I'll get a version with the
- fixes! I still remember never getting the 2.0.1 bug fixes to MacApp, even though they
- were promised to me when I got that CD in '90 :-(.
-
- - --
- Matt Holiday #include <std/disclaimer>
- holiday@bnr.ca
- BNR Richardson, TX
-
- +++++++++++++++++++++++++++
-
- From: Bruce.Hoult@bbs.actrix.gen.nz
- Date: 22 Sep 92 02:26:36 GMT
- Organization: Actrix Information Exchange
-
- In article <1992Sep21.215114.19519@bnr.ca> holiday@bnr.ca writes:
- > In article <1992Sep21.114211.2561@actrix.gen.nz>, Bruce.Hoult@bbs.actrix.gen.nz writes:
- > |> I don't think I've seen anyone post details of just what exactly was wrong
- > |> with MPW C 3.2.3 on ETO #8.
- > |>
- > |> Well, I got the special 3.2.4 update posting (dated 18/9/92) today --
- > |> kudos to the MPW guys for getting this out quickly.
- > |>
- >
- > Where exactly is the updated compiler? I'd like to get the 3.2.3 C/C++ update from APDA
- > on CD-ROM, but I won't order it until I know for sure that I'll get a version with the
- > fixes! I still remember never getting the 2.0.1 bug fixes to MacApp, even though they
- > were promised to me when I got that CD in '90 :-(.
-
- Sorry I wasn't more specific: it arrived via TNT Skypak International
- Express with a little green sticker saying "Priority Service". It's
- just a single floppy disk with compressed versions of C 3.2.4 and C
- 3.2.2, a new version of CMarker, and a CExamples folder.
-
- I'm just a regular ETO customer, so you chaps in the US of A should
- get yours soon :-)
-
- - -- Bruce
- (who can't quite beleive he seems to be getting stuff first out here in NZ)
-
- - --
- Bruce.Hoult@bbs.actrix.gen.nz Twisted pair: +64 4 477 2116
- BIX: brucehoult Last Resort: PO Box 4145 Wellington, NZ
- "Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB
- hard disk that fits in your pocket!" "Great! Is it PC compatible?"
-
- +++++++++++++++++++++++++++
-
- From: keith@taligent.com (Keith Rollin)
- Date: 23 Sep 92 19:59:48 GMT
- Organization: Taligent
-
- In article <38786@unix.SRI.COM>, mxmora@unix.SRI.COM (Matt Mora) wrote:
- >
- > In article <1992Sep21.114211.2561@actrix.gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
- >
- > >- A bus error would occur when compiling with "-sym on".
- >
- > [Other 26 bug fixes deleted]
- >
- > Has THINK C or THINK Pascal ever had that many bugs? They charge you for that
- > buggy compiler? :-) How do you MPW heads get anything done?
- >
-
- I got this file right here called "About THINK C 5.0.3." It details at
- least 48 bugs fixed from THINK C 5.0 to 5.0.3. That doesn't count any of
- the documentation errors or "gotchas" that don't quite qualify as bugs.
-
- - -----
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
- +++++++++++++++++++++++++++
-
- From: potts@itl.itd.umich.edu (Paul Potts)
- Date: 24 Sep 92 14:26:26 GMT
- Organization: Instructional Technology Laboratory, University of Michigan
-
- In article <keith-230992125712@kip-58.taligent.com> keith@taligent.com (Keith Rollin) writes:
- >In article <38786@unix.SRI.COM>, mxmora@unix.SRI.COM (Matt Mora) wrote:
- >>
- >> In article <1992Sep21.114211.2561@actrix.gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
- >> Has THINK C or THINK Pascal ever had that many bugs? They charge you for that
- >> buggy compiler? :-) How do you MPW heads get anything done?
- >>
- >
- >I got this file right here called "About THINK C 5.0.3." It details at
- >least 48 bugs fixed from THINK C 5.0 to 5.0.3. That doesn't count any of
- >the documentation errors or "gotchas" that don't quite qualify as bugs.
-
- All compilers have bugs. If you don't find them, it just means you aren't
- doing anything difficult... :)
-
-
- - --
- "...remove protective cap. Hold atomizer with thumb at base and nozzle
- between first and second fingers. Without tilting head, insert nozzle into
- nostril. Fully depress rim with a firm, even stroke and sniff deeply."
- - -advice for presidential candidates from Paul Potts - potts@itl.itd.umich.edu
-
- ---------------------------
-
- From: eijkhout@cupid.cs.utk.edu (Victor Eijkhout)
- Subject: Think Pascal and ResEdit questions
- Date: 28 Sep 92 16:51:55 GMT
- Organization: University of Tennessee, Knoxville - Department of Computer Science
-
- Hello,
-
- working with Think Pascal and ResEdit (and being mondo pissed that the
- Pascal manual nowhere mentions that you need ResEdit for creating resources),
- I had the following questions:
-
- 1/ using system 7 I would like to have both Pascal and ResEdit open, but
- if I'm editing the resource, Pascal has trouble finding elements (menubar
- for instance) in it. So I have to close the resource every time I want
- to test run the program. Is there an explanation / work-around for this?
-
- 2/ I have programmed mouse-and-menu programs before on the Atari ST, and
- the resource construction programs there gave you a possibility to
- give symbolic names to items in the resource, which you then used in your
- program. This way alterations in the resource do not necessitate alterations
- in the program. Is such a thing possible with ResEdit, combined with Think
- Pascal?
-
- Thanks in advance.
-
- Victor.
-
- +++++++++++++++++++++++++++
-
- From: tree@kira.uvm.edu (Tom Emerson)
- Date: 28 Sep 92 18:22:01 GMT
- Organization: University of Vermont, EMBA Computer Facility
-
- In article <lcee1bINNlej@utkcs2.cs.utk.edu> eijkhout@cupid.cs.utk.edu (Victor Eijkhout) writes:
-
- 1/ using system 7 I would like to have both Pascal and ResEdit open, but
- if I'm editing the resource, Pascal has trouble finding elements (menubar
- for instance) in it. So I have to close the resource every time I want
- to test run the program. Is there an explanation / work-around for this?
-
- There is no workaround. The resource file can *not* be open in two
- applications simultaneously. One way to deal with that is to put your resource
- file in the open special item in ResEdit's File menu.
-
- 2/ I have programmed mouse-and-menu programs before on the Atari ST, and
- the resource construction programs there gave you a possibility to
- give symbolic names to items in the resource, which you then used in your
- program. This way alterations in the resource do not necessitate alterations
- in the program. Is such a thing possible with ResEdit, combined with Think
- Pascal?
-
- Not as such. You can define a group of constants in your source file for
- particular parts of your dialog or for resource id's. I'm not sure I
- understand how the symbolic names of the Atari system differ from the resource
- id's used with the Mac?
-
- Tom
- - --
- Tom Emerson Technical Support
- Language Products Group Symantec Corporation
- Internet: tree@uvm.edu
-
- +++++++++++++++++++++++++++
-
- From: eijkhout@cupid.cs.utk.edu (Victor Eijkhout)
- Date: 28 Sep 92 18:32:46 GMT
- Organization: University of Tennessee, Knoxville - Department of Computer Science
-
- In article <TREE.92Sep28132201@kira.uvm.edu>, tree@kira.uvm.edu (Tom Emerson) writes:
- |> In article <lcee1bINNlej@utkcs2.cs.utk.edu> eijkhout@cupid.cs.utk.edu (Victor Eijkhout) writes:
- |>
- |> 2/ I have programmed mouse-and-menu programs before on the Atari ST, and
- |> the resource construction programs there gave you a possibility to
- |> give symbolic names to items in the resource, which you then used in your
- |> program. This way alterations in the resource do not necessitate alterations
- |> in the program. Is such a thing possible with ResEdit, combined with Think
- |> Pascal?
- |>
- |> Not as such. You can define a group of constants in your source file for
- |> particular parts of your dialog or for resource id's. I'm not sure I
- |> understand how the symbolic names of the Atari system differ from the resource
- |> id's used with the Mac?
-
- On the Atari the resource construction program yielded a .RSC file
- with the resource and a .RSD file with for C 'define' and for Pascal
- 'Const' statements equating for instance
- Const File_menu = 129,
- where in the res. program you have told that 'File_menu' is the label
- for the file menu.
-
- This file is then loaded into your program, and you only have
- to remember the name 'File_menu', and not its ID. I seem to remember
- that there were reasons why you wanted to renumber in a resource every
- once in a while, and then these names are very convenient.
-
- If I've understood ResEdit correctly, then the number of an item in a
- menu is simply the number of the line it appears on. This is awful:
- If I insert a menu item higher up I have to change the item ID in
- my program. Have I really understood this correctly?
-
- |> Tom
-
- Victor.
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Date: 28 Sep 92 18:59:28 GMT
- Organization: Kalamazoo College
-
- eijkhout@cupid.cs.utk.edu (Victor Eijkhout) writes:
- >tree@kira.uvm.edu (Tom Emerson) writes:
- >|>eijkhout@cupid.cs.utk.edu (Victor Eijkhout) writes:
- >|>
- >|> 2/ I have programmed mouse-and-menu programs before on the Atari ST, and
- >|> the resource construction programs there gave you a possibility to
- >|> give symbolic names to items in the resource, which you then used in your
- >|> program.
- >|> ... Is such a thing possible with ResEdit, combined with Think
- >|> Pascal?
- >|>
- >|> Not as such.
- >
- >On the Atari the resource construction program yielded a .RSC file
- >with the resource and a .RSD file with for C 'define' and for Pascal
- >'Const' statements...
- >
- >This file is then loaded into your program, and you only have
- >to remember the name 'File_menu', and not its ID.
- >
- >If I've understood ResEdit correctly, then the number of an item in a
- >menu is simply the number of the line it appears on. This is awful:
- >If I insert a menu item higher up I have to change the item ID in
- >my program. Have I really understood this correctly?
-
- Yes, you have. A nice extension to Think C 4.0.x, "4Plus", provided
- this and many other features. (Not for menu items, though--it would
- produce a .h file that did 'enum's attaching resource names to IDs.
- So you could change menu numbers on the fly, but not menu items.)
-
- This would be a way-cool tool, if someone wanted to write it--a
- drag-n-drop app that accepted any file, and spelled out its resources in
- some clean header file. Preferences would include: whether to write a
- C or Pascal header; the prefix for all the constants ("r", for
- example); whether to convert "two word" to "two_word" or "twoWord";
- and so on. The option of writing separate files for separate groups of
- resources would be nice too--when I change a menu item, I don't want to
- have to recompile all my C files that #include the enumerations of the
- 'snd ' resources.
-
- Hmmm. If I didn't already have six things on the back burners, I'd
- consider tossing this one on too. Or has it been done already?
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- "To flame someone on an open forum is, to me, the height of insensitivity."
- - P.J. Plauger
-
- +++++++++++++++++++++++++++
-
- From: jbush@magnus.acs.ohio-state.edu (J Eric Bush)
- Date: 28 Sep 92 19:54:08 GMT
- Organization: The Ohio State University
-
- In article <lcee1bINNlej@utkcs2.cs.utk.edu> eijkhout@cupid.cs.utk.edu (Victor E
- ijkhout) writes:
- >Hello,
- >
- >working with Think Pascal and ResEdit (and being mondo pissed that the
- >Pascal manual nowhere mentions that you need ResEdit for creating resources),
- >I had the following questions:
- >
- >1/ using system 7 I would like to have both Pascal and ResEdit open, but
- >if I'm editing the resource, Pascal has trouble finding elements (menubar
- >for instance) in it. So I have to close the resource every time I want
- >to test run the program. Is there an explanation / work-around for this?
- >
- >2/ I have programmed mouse-and-menu programs before on the Atari ST, and
- >the resource construction programs there gave you a possibility to
- >give symbolic names to items in the resource, which you then used in your
- >program. This way alterations in the resource do not necessitate alterations
- >in the program. Is such a thing possible with ResEdit, combined with Think
- >Pascal?
- >
- >Thanks in advance.
- >
- >Victor.
- >
- >
-
- 1/ ResEdit will mark a file as being opened with the ability to read and
- write so another program can't have access to it at the same time. The
- best work around is use the "Modify Menu" option in ResEdit so that
- command-1 opens the resource you want to edit. Edit it, then close it
- when returning to Pascal, it can access everything just fine. When you
- want to go back to ResEdit switch to it under mutilfinder and press
- command-1 and your back to editting your resource. BTW, Think Pascal
- manuals do mention ResEdit all over the place. Each of the examples
- are based on ResEdit and it comes with the program.
-
- 2/ If you want to use symbolic names, you have to use the ResEdit Get Info
- command and then type in a name for the resource. Note: I have given
- names to resources, but do not use them in programs, so if this doesn't
- work, forget where you heard this.
-
- Eric
- - --
- - ------------------------------------------------------------------------------
- J. Eric Bush
- Internet: jbush@magnus.acs.ohio-state.edu
-
- +++++++++++++++++++++++++++
-
- From: peter@cujo.curtin.edu.au (Peter N Lewis)
- Date: 29 Sep 92 03:30:55 GMT
- Organization: NCRPDA, Curtin University
-
- In article <lcee1bINNlej@utkcs2.cs.utk.edu>, eijkhout@cupid.cs.utk.edu
- (Victor Eijkhout) wrote:
-
- > 1/ using system 7 I would like to have both Pascal and ResEdit open, but
- > if I'm editing the resource, Pascal has trouble finding elements (menubar
- > for instance) in it. So I have to close the resource every time I want
- > to test run the program. Is there an explanation / work-around for this?
-
- No, there is no workaround, but once you've selected the resource file
- once, ResEdit remembers where you looked, so reopening it is generally not
- too difficult, and the suggestion of putting the resource file in the Open
- Special menu in ResEdit was a good one (assuming you only have a few
- projects at once :-)
-
- > 2/ I have programmed mouse-and-menu programs before on the Atari ST, and
- > the resource construction programs there gave you a possibility to
- > give symbolic names to items in the resource, which you then used in your
- > program. This way alterations in the resource do not necessitate alterations
- > in the program. Is such a thing possible with ResEdit, combined with Think
- > Pascal?
-
- There is no app to do this to my knowledge. What I did was implement
- fmnu's ala Finder, which creates a mapping between an OSType (eg 'quit')
- and menu's (eg thew 'Quit/Q' menu). In my code I do things like:
-
- SetFCommand('quit',@DoQuit)
-
- And then when a menu is chosen, its OSType is found and the relevent
- procedure is called. It also associates an Enable procedure with each
- menu, to grey/ungrey the menu as appropriate.
-
- The code for this is in my Talk sources, which are available on
- redback.cs.uwa.edu.au:/others/peterlewis (as well as on sumex and umich).
- Thanks to Quinn and UWA Comp Sci for providing this site.
-
- HTH,
- Peter.
-
- _______________________________________________________________________
- Peter N Lewis, NCRPDA, Curtin University peter@cujo.curtin.edu.au
- GPO Box U1987, Perth WA 6001, AUSTRALIA FAX: +61 9 367 8141
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-